from datetime import datetime

from sqlalchemy import Column, Integer, String, CHAR, DECIMAL
 
from app.models.base import Base, db


class aigc_report_info(Base):
    __tablename__ = 'aigc_report_info'
    id = Column(Integer, primary_key=True, autoincrement=True)
    order_number = Column(String(80), default='')
    title = Column(String(200), nullable=False)
    author = Column(String(100), default='佚名')
    chars_sum = Column(Integer, default=0)
    rate = Column(DECIMAL(5, 2), default=0)
    paragraph_count = Column(Integer, default=0)
    sentence_count = Column(Integer, default=0)
    user = Column(Integer, default=0)
    completed = Column(Integer, default=0)
    pdfname = Column(String(200), default='')
    locked = Column(Integer, default=0)

    def keys(self):
        return ['id', 'order_number', 'title', 'author', 'chars_sum', 'rate',
                'paragraph_count', 'sentence_count', 'create_datetime', 'user', 'completed', 'locked', 'pdfname']
